﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Windows;
using Galaxy.AutoCAD.UserControls;

[assembly: CommandClass(typeof(Galaxy.AutoCAD.Palettes.PaletteTool))]
namespace Galaxy.AutoCAD.Palettes
{
    public static class PaletteTool
    {
        public static PaletteSet ps = null;
        [CommandMethod("WENZHANG")]
        public static void LoadGalaxyAddin()
        {
            if (ps == null || ps.IsDisposed)
            {
                ps = new PaletteSet("银河插件",typeof(PaletteTool).GUID);
                ps.Style = PaletteSetStyles.SingleColDock;
                ps.Size = new System.Drawing.Size(120, 120);
                ps.MinimumSize = new System.Drawing.Size(120, 120);
                System.Windows.Forms.UserControl uc = new GalaxyToolSet();
                ps.Add("银河插件", uc);
                ps.Dock = DockSides.Right;
                ps.Visible = true;
                Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\n银河插件加载成功");
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("银河插件已经加载！", "【银河插件】提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
            }
        }
    }
}
